import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/collegeHrSystemUI";

// 查询用户列表
export function getPageList(query) {
  return request({
    url: '/user/getPageList',
    method: 'get',
    params: query
  })
}

// 新增用户
export function add(data) {
  return request({
    url: '/user/add',
    method: 'post',
    data: data
  })
}

// // 修改用户
export function edit(data) {
  return request({
    url: '/user/edit',
    method: 'put',
    data: data
  })
}

// 用户密码重置
export function resetUserPassword(data) {
  return request({
    url: '/user/resetUserPassword',
    method: 'put',
    data: data
  })
}

// 查询用户列表
export function checkNameIsUnique(query) {
  return request({
    url: '/user/checkNameIsUnique',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getDetail(query) {
  return request({
    url: '/user/getDetail',
    method: 'get',
    params: query
  })
}
// 删除用户
export function del(userId) {
  return request({
    url: '/user/del/' + userId,
    method: 'delete'
  })
}
// 用户修改密码
export function editUserPassword(data) {
  return request({
    url: '/user/editUserPassword',
    method: 'put',
    data: data
  })
}
